import request from '@/utils/request.js'
import { musicApi } from '@/utils/apiUtils.js'


export const musicUploadService = (data) =>
  request.post(musicApi('/upload'), data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })

export const randomListService = (n) =>
  request.get(musicApi('/random-list?n=' + n))

export const getListService = () =>
  request.get(musicApi('/list'))

export const getMusicService = (mid) =>
  request.get(musicApi('?mid=' + mid))

export const getSearchListService = (name) =>
  request.get(musicApi(`/s-list?name=${name}`))
